<?php
declare (strict_types=1);

namespace app\admin\model\data;

use think\model\concern\SoftDelete;

/**
 * Class Paper
 *
 * @package app\admin\model\data
 */
class Paper extends DataModel
{
    use SoftDelete;

    /**
     * 表名
     *
     * @var string
     */
    protected $name = 'exam_paper';

    /**
     * 获取某个时间段的试卷新增
     * Author   Martinsun<syh@sunyonghong.com>
     * Date 2020-07-21
     *
     * @param array $timespan [description]
     * @return   [type]                                   [description]
     */
    public static function getPaperCountByTimespan(array $timespan)
    {
        return Paper::scope('mhm')->whereBetween('__TABLE__.create_time', $timespan)
            // ->where('status', 1)
            ->count();
    }
}